package com.flnet.treasure.domain;

import java.io.Serializable;

public class Result implements Serializable{
	/**
	 * 执行状态
	 */
	private boolean success;
	/**
	 * 返回对象
	 */
	private Object object;
	/**
	 * 返回消息
	 */
	private String msg;
	
	private int status;

	public Result() {
		super();
	}

	public Result(boolean success) {
		super();
		this.success = success;
	}

	public Result(boolean success, Object object) {
		super();
		this.success = success;
		this.object = object;
	}

	public Result(boolean success, String msg) {
		super();
		this.success = success;
		this.msg = msg;
	}

	public Result(boolean success, Object object, String msg) {
		super();
		this.success = success;
		this.object = object;
		this.msg = msg;
	}

	public boolean isSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public Object getObject() {
		return object;
	}

	public void setObject(Object object) {
		this.object = object;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}
	
	public static Result returnSuccess(){
		return new Result(true,"操作成功");
	}
	
	public static Result returnFailure(){
		return new Result(false,"操作失败");
	}
	
	public static Result returnFailure(String msg){
		return new Result(false,msg);
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public static Result returnSuccess(String msg) {
		return new Result(true,msg);
	}
	
	
}

